import { IKeyMap } from "./IKeyMap";
import { KeyCode } from "./KeyCode";
type int = number;
//class KeyData

    export  class KeyData
    {
        constructor(arg1: uint=0, arg2: Boolean=false)
        {
            
            this.keyCode = arg1;
            this._isShift = arg2;
            this.updateKey(arg1, this._isShift);
            return;
        }

        public get keyMap(): IKeyMap
        {
            return this._keyMap;
        }

        public set keyMap(arg1: IKeyMap)
        {
            this._keyMap = arg1;
            return;
        }

        public get isShift(): Boolean
        {
            return this._isShift;
        }

        public set isShift(arg1: Boolean)
        {
            this._isShift = arg1;
            return;
        }

        public get shortcutsName(): string
        {
            return this._shortcutsName;
        }

        /* internal  */updateKey(arg1: int, arg2: Boolean): void
        {
            this.keyCode = arg1;
            this._isShift = arg2;
            if (this._isShift) 
            {
                this.key = arg1 + KeyCode.SHIFT_NUM;
            }
            else 
            {
                this.key = arg1;
            }
            if (this._isShift) 
            {
                this._shortcutsName = "sht+" + KeyCode.getKeyName(this.keyCode);
            }
            else 
            {
                this._shortcutsName = KeyCode.getKeyName(this.keyCode);
                if (this._shortcutsName == null) 
                {
                    this._shortcutsName = "";
                }
            }
            return;
        }

        public /* var */key: int;

        public /* var */isKeyDown: Boolean=false;

        public /* var */keyCode: uint;

        private /* var */_keyMap: IKeyMap;

        private /* var */_isShift: Boolean;

        private /* var */_shortcutsName: string;
    }
